<template>
  <el-select v-model="value" v-bind="$attrs">
    <el-option
      v-for="item in options"
      :key="item.value"
      :label="item.label"
      :value="item.value"
    />
  </el-select>
</template>

<script setup lang="ts">
import { computed } from 'vue'

import defaultProps, { defaultEmits } from './props.ts'

const props = defineProps(defaultProps)
const emits = defineEmits(defaultEmits)

const value = computed({
  get: () => {
    return props.modelValue
  },
  set: (val) => {
    emits('update:modelValue', val)
  }
})

defineOptions({
  name: 'CESelect'
})
</script>

<style scoped lang="scss"></style>
